home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / fonts / 0002_53.81 / fnt-3129 / uniscrol.1_1 / uniscrl2.s < prev    next >
Text File  |  1987-04-21  |  9KB  |  230 lines

  1. *******************************************************************************
  2. **                         UNIVERSAL-SCROLL-ROUTINE                          **
  3. **                      ------------------------------                       **
  4. **                     Coded by TPD of Death on 11.02.91                     **
  5. **                     Last changes: 15.5.91
  6. *******************************************************************************
  7. ** Contact us:  DEATH, Postfach 73,6370 Stans, Switzerland                   **
  8. *******************************************************************************
  9. line            EQU 100         * Here you can set the upper line, in which
  10. *                               * the scroll shall begin
  11.  
  12.                 pea     init            * Execute a Supervisor
  13.                 move.w  #$26,-(SP)      * routine
  14.                 trap    #14
  15.                 addq.l  #6,SP
  16.  
  17.                 move.w  #7,-(SP)
  18.                 trap    #1
  19.                 addq.l  #2,SP
  20.  
  21. ende:           pea     exit
  22.                 move.w  #$26,-(SP)      * routine
  23.                 trap    #14
  24.                 addq.l  #6,SP
  25.  
  26.  
  27.                 clr.w   -(SP)           * Terminate
  28.                 trap    #1
  29. ***********************************************************************************
  30. ***********************************************************************************
  31. scrolling:
  32.                 movem.l D0-A6,-(SP)
  33.  
  34.                 move.l  logram,D0       * change logical and
  35.                 move.l  vidram,logram   * physical videoram
  36.                 move.l  D0,vidram       *
  37.                 move.l  D0,$045E        *
  38. *****************************************
  39. * Verschieben um 16 Pixel               *
  40. *****************************************
  41.                 move.w  heigth(PC),D0   * Heigth of the Scroller
  42.                 movea.l logram,A6       * Write to the invisible Videoram
  43.                 lea     160*line(A6),A6
  44. moveloop:
  45.                 movem.l 8(A6),D1-A5     * Get data
  46.                 movem.l D1-A5,(A6)      * write Data
  47.  
  48.                 movem.l 60(A6),D1-A5
  49.                 movem.l D1-A5,52(A6)
  50.  
  51.                 movem.l 112(A6),D1-A5
  52.                 movem.l D1-A5,104(A6)
  53.  
  54.                 lea     156(A6),A6      * Set A6
  55.                 move.l  8(A6),(A6)+     * onto next line
  56.  
  57.                 dbra    D0,moveloop
  58.  
  59.  
  60.                 movea.l char_1(PC),A0
  61.                 adda.w  width_counter(PC),A0 *
  62. *****************************************
  63. * shifting                              *
  64. *****************************************
  65.                 move.w  width(PC),D7
  66.                 addq.w  #1,D7           * Add 1 for upper byte
  67.                 movea.l logram,A1
  68.                 lea     160*line(A1),A1
  69.                 move.w  heigth(PC),D0
  70.  
  71.                 not.w   n_ev_count      * It either starts the first
  72.                 tst.w   n_ev_count      * or the second shifting-routine.
  73.                 beq.s   not_even        * Depends from the position of the scroller
  74. even:
  75. shift_loop_even:
  76.                 move.w  (A0),152(A1)    * Insert new data
  77.                 move.w  2(A0),154(A1)
  78.                 move.w  4(A0),156(A1)
  79.                 move.w  6(A0),158(A1)
  80.  
  81.                 adda.w  D7,A0           * offset to next word of used data
  82.  
  83.                 lea     160(A1),A1      * Set onto next line
  84.  
  85.                 dbra    D0,shift_loop_even
  86.  
  87.                 bra.s   end_shift       * Don't execute the other Shift-rout
  88. ***********************************************
  89. not_even:
  90.                 addq.w  #8,width_counter * Add
  91.                 lea     8(A0),A3
  92.  
  93.  
  94.                 cmp.w   width_counter(PC),D7 * Is offset > width of char+1  ???
  95.                 bgt.s   not_end_of_the_char
  96.                 movea.l char_2(PC),A3   * Adress of new char if at the end
  97. not_end_of_the_char:
  98. shift_loop_not_even:
  99.                 move.b  1(A0),152(A1)   * insert new data at the right border
  100.                 move.b  3(A0),154(A1)
  101.                 move.b  5(A0),156(A1)
  102.                 move.b  7(A0),158(A1)
  103.  
  104.                 move.b  (A3),153(A1)
  105.                 move.b  2(A3),155(A1)
  106.                 move.b  4(A3),157(A1)
  107.                 move.b  6(A3),159(A1)
  108.  
  109.                 adda.w  D7,A0           * offset to next word of used data
  110.                 adda.w  D7,A3
  111.  
  112.                 lea     160(A1),A1      * Next line
  113.                 dbra    D0,shift_loop_not_even
  114.  
  115.  
  116. *****************************************
  117. end_shift:
  118.  
  119.                 move.w  width(PC),D7
  120.                 cmp.w   width_counter(PC),D7
  121.  
  122.                 bge.s   no_inc          * Is the End of the character reached
  123.  
  124.                 move.w  #0,width_counter * Clear width-counter
  125.                 addq.w  #1,char_counter * Add 1 to the Char-counter
  126.  
  127.                 bsr.s   get_2_chars     * Get the next character
  128.  
  129. no_inc:                                 * No increment
  130. no_move:
  131.                 movem.l (SP)+,D0-A6
  132.                 rts
  133. ************************************************
  134. * Neues Zeichen zum Einshiften lesen
  135. ************************************************
  136. get_2_chars:    move.l  char_2(PC),char_1
  137.                 lea     stext(PC),A0    * Get character
  138.                 adda.w  char_counter(PC),A0
  139.                 move.b  (A0),D0
  140.                 cmpi.b  #0,D0           * Is it the end of the text ???
  141.  
  142.                 bne.s   not_the_end_of_the_scro
  143.  
  144.                 move.w  #-1,char_counter * clear Char-counter
  145.                 clr.w   width_counter   * clear Width-counter
  146.                 rts                     * Restart everything
  147.  
  148. not_the_end_of_the_scro:
  149.                 moveq   #0,D0           * get next char
  150.                 move.b  (A0)+,D0        * out of the text
  151.  
  152. ******* new data=font+(ASC("CHAR")-32)*(width+1)*heigth+1)
  153.  
  154.                 sub.w   #32,D0          * Get the beginning of the
  155.                 move.w  width(PC),D1    * Char in the Font
  156.                 addq.w  #1,D1
  157.                 mulu    D1,D0           *
  158.                 move.w  heigth(PC),D1
  159.                 add.w   #1,D1
  160.                 mulu    D1,D0
  161.                 lea     font+42(PC),A0
  162.                 adda.l  D0,A0
  163.                 move.l  A0,char_2
  164.                 rts
  165. ************************************************************************
  166. ************************************************************************
  167. init:
  168.                 move.l  #puffers+256,D0 * reserved memory of the Videoram
  169.                 clr.b   D0              * Clear low byte
  170. *                                       * = andi.w #$FFFFFF00,d0
  171.                 move.l  D0,logram
  172.                 add.l   #200*160,D0
  173.                 move.l  D0,vidram
  174.  
  175.                 lea     font(PC),A0     * Get information about font
  176.                 cmpi.l  #"F32+",(A0)+   * Is it a DEATH-Font ?????
  177.  
  178.                 bne     ende            * No it isn't !!!!!!!!!!!!!!!
  179.  
  180.                 move.w  (A0)+,heigth    * Get heigth of scroller
  181.                 move.w  (A0)+,width     * Get width of one char
  182.                 move.w  (A0)+,anz_planes * get amount of planes (Not used up to now)
  183.  
  184.                 movem.l $FFFF8240.w,D0-D7 * save colors
  185.                 movem.l D0-D7,oldpal
  186.  
  187.                 movem.l (A0)+,D0-D7     * Get colors
  188.                 movem.l D0-D7,$FF8240   * Set colors
  189.  
  190.                 move.l  #scrolling,$04DA.w * Set the VBL-interrupt
  191.  
  192.                 rts
  193. ************************************************************************
  194. do_text:
  195.  
  196.  
  197.                 rts
  198. ************************************************************************
  199. exit:
  200.                 move.l  #0,$04DA.w      * erase VBL-routine
  201.  
  202.                 movem.l oldpal(PC),D0-D7 * restore colors
  203.                 movem.l D0-D7,$FFFF8240.w
  204.                 rts
  205.  
  206. ************************************************************************
  207. oldpal:         DS.W 16
  208. stext:          DC.B "HELLO DEAR DEMOFREAK !!!!!! LET US TRY ALL CHARS:"
  209.                 DC.B 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51
  210.                 DC.B 52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71
  211.                 DC.B 72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90
  212.                 DC.B "                         "
  213.                 DC.B 0
  214. stextend:       EVEN
  215. char_1:         DC.L font+42
  216. char_2:         DC.L font+42
  217. n_ev_count:     DC.W 0
  218. char_counter:   DC.W -1
  219. width_counter:  DC.W 0
  220. heigth:         DC.W 0
  221. width:          DC.W 0
  222. anz_planes:     DC.W 0
  223. font:           INCBIN 'A:\FONTS\*.F*'
  224. vidram:         DC.L 0
  225. logram:         DC.L 0
  226.  
  227.                 BSS
  228. puffers:        DS.B 160*200*2
  229.                 END
  230.